<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/door/door.js"></script>
		<style>
		    .doorinfo{
		        margin-top: 150px;
			    width: 95%;
			    text-align: left;
			    margin-left: 55px;		    
		    }
		    
		    
		    .dwh {
			    border: 1px solid #80808052;
			    text-align: center;
			    background-color: #80808024;
			}
			
			.ic {
			    display: inline-block;
			    width: 60px;
			    height: 25px;
			    vertical-align: middle;
			    margin-top: 5px;
			}
			.mycheckbox{
			    width: 25px;
			}
		</style>
	</head>
	<body>
		<!-- 顶部按钮 -->
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<div class="panel-toolbar ">
				<div class="buttons">
					<a href="javascript:void(0);" class="btn btn-primary fa fa-save" ><span>保存</span></a>
					<a href="list.htm" class="btn btn-primary fa fa-back" ><span>返回</span></a>
				</div>
			</div>
			<div class="">
				<form  class="fr-form"  id="doorForm" action="save.htm" >
					<input type="hidden" name="m:door:doorid"  value="${door.doorid}"/>
					<input type="hidden" name="m:door:servicecode"  value="${door.servicecode}"/>
					<div class="fr_response_field col-sm-3" >
					 	<div class="fr-form-group"> 
						 	<label class="fr-control-label">控制器名称</label>
						  	<div class="fr-form-block" data-type="fixed">
						         <input type="hidden" class="fr-form-control" readonly="readonly" name="m:door:controllerid" value="${door.controllerid}" validate="{required:true}"/>
						         <input type="text" class="fr-form-control" readonly="readonly" value="${door.controllername}" validate="{required:true}"/>					
						 	</div>
					  	</div>
					</div>
					<div class="fr_response_field col-sm-3" >
					 	<div class="fr-form-group"> 
						 	<label class="fr-control-label">门编号</label>
						  	<div class="fr-form-block" data-type="fixed">
						         <input type="text" class="fr-form-control" readonly="readonly"  name="m:door:doorno" value="${door.doorno}" validate="{required:true}"/>					
						 	</div>
					  	</div>
					</div>
					<div class="fr_response_field col-sm-3" >
					 	<div class="fr-form-group"> 
						 	<label class="fr-control-label">门名称 </label>
						  	<div class="fr-form-block" data-type="fixed">
						        <input type="text" class="fr-form-control" name="m:door:doorname" value="${door.doorname}" validate="{required:false}"/>						        						  					
						 	</div>
					  	</div>
					</div>
					
					<div class="fr_response_field col-sm-3" >
					 	<div class="fr-form-group"> 

						  	<div class="fr-form-block" data-type="fixed">
						       			        						  					
						 	</div>
					  	</div>
					</div>
					
				   <div class="fr_response_field col-sm-3" >
					 	<div class="fr-form-group"> 
						 	<label class="fr-control-label">门控制方式 </label>
						  	<div class="fr-form-block dwh" data-type="fixed">						       
						        <div class="ic"><input type="radio"  name="m:door:doorcontrol" value="3" ${door.doorcontrol eq '3'? 'checked=true':''}>在线</div> 
								<div class="ic"><input type="radio"  name="m:door:doorcontrol" value="1" ${door.doorcontrol eq '1'? 'checked=true':''}>常开</div> 
								<div class="ic"><input type="radio"  name="m:door:doorcontrol" value="2" ${door.doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  								  					
						 	</div>
					  	</div>
					</div>
					
					<div class="fr_response_field col-sm-3" >
					 	<div class="fr-form-group"> 
						 	<label class="fr-control-label">开门延时</label>
						  	<div class="fr-form-block" data-type="fixed">
						           <input type="number" class="fr-form-control" name="m:door:doordelay" value="${door.doordelay}" validate="{required:true}"/>				  					
						 	</div>
					  	</div>
					</div>
					
					<input type="hidden" id="doorenabled" name="m:door:doorenabled" value="${door.doorenabled}" validate="{required:false}"/>

					<div class="fr_response_field col-sm-1" >
					 	<div class="fr-form-group"> 
						 	<label class="fr-control-label">进门</label>
						  	<div class="fr-form-block" data-type="fixed">
							       <input type="checkbox" class="fr-form-control mycheckbox" id="doors1"  ${door.doorenabled.substring(0,1) eq '1'? 'checked=true':''} />				  					
						 	</div>
					  	</div>
					</div>
				    <c:if test="${door.controllerid.substring(0,1) == '4'}">	
						<div class="fr_response_field col-sm-1" >
                              <input type="checkbox" class="fr-form-control mycheckbox" id="doors2" style="display:none;" />					           				  					
						</div>
					</c:if> 
					
					<c:if test="${door.controllerid.substring(0,1) != '4'}">	
						<div class="fr_response_field col-sm-1" >
						 	<div class="fr-form-group"> 
							 	<label class="fr-control-label">出门</label>
							  	<div class="fr-form-block" data-type="fixed">
							          <input type="checkbox" class="fr-form-control mycheckbox" id="doors2"  ${door.doorenabled.substring(1,2) eq '1'? 'checked=true':''} />					           				  					
							 	</div>
						  	</div>	
						</div>
					</c:if> 
					
					
					
					
                </form>
			</div>
		</div>
		
		<script type="text/javascript" >
		   $(
				function(){
					$(".mycheckbox").change(							
						function(){							
							var p1 = $("#doors1").prop('checked')? '1':'0';
							var p2 = $("#doors2").prop('checked')? '1':'0';
							$("#doorenabled").val(""+p1+p2);							
						}
							
					);					   
			    }
		  );
		
		
		
		</script>
		
		
	</body>
</html>